<?php /* Smarty version 2.6.18, created on 2016-12-23 15:01:10
         compiled from file/file.list.tpl.php */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
  <div class="content-wrapper">
    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-md-2">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "file/file.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
          <!-- /. box -->
        </div>
        <!-- /.col -->
        <div class="col-md-10">
          <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title"><?php echo $this->_tpl_vars['folder_title']; ?>
<small style="font-size:12px; margin-left:8px;">共<?php echo $this->_tpl_vars['count']; ?>
个</small></h3>

             <form name="form1" method="get" action="">
              <div class="box-tools pull-right">
                <div class="has-feedback">
                  <input type="text" name="s" value="<?php echo $this->_tpl_vars['s']; ?>
" class="form-control input-sm" placeholder="搜 索">
				  <input type="hidden" name="a" value="file.list">
				  <input type="hidden" name="file_folder" value="<?php echo $this->_tpl_vars['file_folder']; ?>
">
                  <span class="glyphicon glyphicon-search form-control-feedback"></span>
				  <button type="submit" style="display:none"></button>
                </div>
              </div>
			</form>
              <!-- /.box-tools -->
            </div>
            <!-- /.box-header -->
			<form name="form2" method="post" action="index.php?a=file.delall">
            <div class="box-body no-padding">
              <div class="mailbox-controls">
                <!-- Check all button -->
                    <a href="index.php?a=file.add&file_folder=<?php echo $this->_tpl_vars['file_folder']; ?>
" class="btn btn-warning btn-sm" title="上传"><i class="fa fa-upload"></i></a>
              </div>
              <div class="table-responsive mailbox-messages">
                <table class="table table-hover table-striped">
                  <tbody>
                  <tr>
                    <td>选择</td>
                    <td class="mailbox-star">类别</td>
                    <td class="mailbox-star">文件名</td>
                    <td class="mailbox-subject">文件大小</td>
					<?php if ($this->_tpl_vars['file_folder'] != 'open'): ?>
                    <td class="mailbox-attachment">目录</td>
					<?php endif; ?>
                    <td class="mailbox-date">时间</td>
                    <td class="mailbox-operate" width="140"> 操作</td>
                  </tr>
				<?php $_from = $this->_tpl_vars['file_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                  <tr>
                    <td><input type="checkbox" name="fids[]" value="<?php echo $this->_tpl_vars['value']['file_id']; ?>
"></td>
                    <td class="mailbox-star"><?php echo $this->_tpl_vars['value']['file_type']; ?>
</td>
                    <td class="mailbox-name" id="fname_<?php echo $this->_tpl_vars['value']['file_id']; ?>
"><a href="<?php echo $this->_tpl_vars['value']['file_path']; ?>
"><?php echo $this->_tpl_vars['value']['file_name']; ?>
</a></td>
                    <td class="mailbox-subject"><?php echo $this->_tpl_vars['value']['file_size']; ?>
</td>
					<?php if ($this->_tpl_vars['file_folder'] != 'open'): ?>
                    <td class="mailbox-attachment"><?php echo $this->_tpl_vars['value']['folder_name']; ?>
</td>
					<?php endif; ?>
                    <td class="mailbox-date"><?php echo $this->_tpl_vars['value']['create_time']; ?>
</td>
                    <td class="mailbox-operate"> 
                        <a href="<?php echo $this->_tpl_vars['value']['file_path']; ?>
" class="btn btn-warning btn-xs" title="下载"><i class="fa fa-download"></i></a>
                        <a href="#" onclick="cp(<?php echo $this->_tpl_vars['value']['file_id']; ?>
)"  class="btn btn-success btn-xs" title="复制" data-toggle="modal" data-target="#mymodal" id="copies">
                             <i class="fa fa-copy (alias)"></i>
                        </a>
                        <?php if ($this->_tpl_vars['user_auth']['user_id'] == $this->_tpl_vars['value']['user_id']): ?>
                        <a href="#" onclick="mv(<?php echo $this->_tpl_vars['value']['file_id']; ?>
)" class="btn btn-info btn-xs" title="转移" data-toggle="modal" data-target=".bs-modal-sm" id="dian">
                             <i class="fa fa-share-square"></i>
                        </a>
                        <a href="index.php?a=file.del&file_id=<?php echo $this->_tpl_vars['value']['file_id']; ?>
" class="btn btn-danger btn-xs"  title="删除" onclick="if(confirm('警告！确认删除信息?')==false)return false;"><i class="fa fa-trash-o"></i></a>
						<?php endif; ?>
                    </td>
                  </tr>
				<?php endforeach; endif; unset($_from); ?>
                  </tbody>
                </table>
              </div>
            </div>
            <!-- /.box-body -->

            <div class="box-footer no-padding">
              <div class="mailbox-controls">
                <!-- Check all button -->
					<input type="hidden" name="f_folder" value="<?php echo $this->_tpl_vars['file_folder']; ?>
">
                    <button type="submit" class="btn btn-danger btn-sm" title="删除"><i class="fa fa-trash-o"></i></button>
                <div class="pull-right">
					<?php echo $this->_tpl_vars['page']; ?>

                </div>
                <!-- /.pull-right -->
              </div>
            </div>
			</form>

          </div>
          <!-- /. box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
   
  <!-- /.content-wrapper -->

<div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document" style="width:400px">
    <div class="modal-content">
       <form action="index.php?a=file.clone" method="post">
          <div class="modal-header">
               <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
               <h4 >文件复制</h4>
          </div>
          <div class="modal-body">
               <div class="form-group">
                        <label class="text-right col-sm-4 control-label" style="font-weight:500; padding-left:0;">
                             文件：
                        </label>
                        <div class="input-group col-sm-7 " id="cp_fname">
                            
                        </div>
                </div>
                 <div class="form-group">
                        <label class="text-right col-sm-4 control-label" style="font-weight:500; padding-left:0;">
                             复制到：
                        </label>
                        <div class="input-group col-sm-7 ">
                             <select style="width:100%; height:30px;" name="file_folder">
							 <?php $_from = $this->_tpl_vars['folder_left']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
								<?php if ($this->_tpl_vars['file_folder'] != 'open'): ?>
                                 <option value="open">共享文件夹</option>
								<?php endif; ?>
								<?php if ($this->_tpl_vars['file_folder'] != '0'): ?>
                                 <option value="0">私人文件夹</option>
								<?php endif; ?>
								<?php if ($this->_tpl_vars['file_folder'] != $this->_tpl_vars['value']['folder_id']): ?>
                                 <option value="<?php echo $this->_tpl_vars['value']['folder_id']; ?>
"><?php echo $this->_tpl_vars['value']['folder_name']; ?>
</option>
								<?php endif; ?>
                             <?php endforeach; endif; unset($_from); ?>
                             </select>
                        </div>
                </div>   
              
              
          </div>
          <div class="modal-footer">
              <input type="hidden" id="cp_id" name="file_id" value="" >            
              <button type="submit" class="btn btn-primary">确 定</button>
              <button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
          </div>
       </form>
    </div>
  </div>
</div>
 <!--弹出框开始-->
</div>
<div class="modal fade bs-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
  <div class="modal-dialog modal-sm" role="document" style="width:400px;">
    <div class="modal-content">
        <form action="index.php?a=file.move" method="post">
          <div class="modal-header">
               <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
               <h4 >文件转移</h4>
          </div>
          <div class="modal-body">
               <div class="form-group">
                        <label class="text-right col-sm-4 control-label" style="font-weight:500; padding-left:0;">
                             选择文件：
                        </label>
                        <div class="input-group col-sm-7 " id="mv_fname">
                        </div>
                </div>
                 <div class="form-group">
                        <label class="text-right col-sm-4 control-label" style="font-weight:500; padding-left:0;">
                             转移到：
                        </label>
                        <div class="input-group col-sm-7 ">
                             <select style="width:100%; height:30px;" name="file_folder">
							 <?php $_from = $this->_tpl_vars['folder_left']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
								<?php if ($this->_tpl_vars['file_folder'] != 'open'): ?>
                                 <option value="open">共享文件夹</option>
								<?php endif; ?>
								<?php if ($this->_tpl_vars['file_folder'] != '0'): ?>
                                 <option value="0">私人文件夹</option>
								<?php endif; ?>
								<?php if ($this->_tpl_vars['file_folder'] != $this->_tpl_vars['value']['folder_id']): ?>
                                 <option value="<?php echo $this->_tpl_vars['value']['folder_id']; ?>
"><?php echo $this->_tpl_vars['value']['folder_name']; ?>
</option>
								<?php endif; ?>
                             <?php endforeach; endif; unset($_from); ?>
                             </select>
                        </div>
                </div>   
              
              
          </div>
          <div class="modal-footer">
              <input type="hidden" id="mv_id" name="file_id" value="" >  
              <button type="submit" class="btn btn-primary">确 定</button>
              <button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
          </div>
       </form>
    </div>
  </div>
</div>
<!--弹出框结束-->
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script type="text/javascript">
	function cp(id)
	{
		var fname = $("#fname_"+id).text();

		$("#cp_id").val(id);
		$("#cp_fname").text(fname);
	}
	function mv(id)
	{
		var fname = $("#fname_"+id).text();

		$("#mv_id").val(id);
		$("#mv_fname").text(fname);
	}
</script>
<!--<script>
  $(function () {
    $('.mailbox-messages input[type="checkbox"]').iCheck({
      checkboxClass: 'icheckbox_flat-blue',
      radioClass: 'iradio_flat-blue'
    });
    $(".checkbox-toggle").click(function () {
      var clicks = $(this).data('clicks');
      if (clicks) {
        //Uncheck all checkboxes
        $(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
        $(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
      } else {
        //Check all checkboxes
        $(".mailbox-messages input[type='checkbox']").iCheck("check");
        $(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
      }
      $(this).data("clicks", !clicks);
    });
    $(".mailbox-star").click(function (e) {
      e.preventDefault();
      //detect type
      var $this = $(this).find("a > i");
      var glyph = $this.hasClass("glyphicon");
      var fa = $this.hasClass("fa");

      //Switch states
      if (glyph) {
        $this.toggleClass("glyphicon-star");
        $this.toggleClass("glyphicon-star-empty");
      }

      if (fa) {
        $this.toggleClass("fa-star");
        $this.toggleClass("fa-star-o");
      }
    });
  });
</script>
-->